#ifndef els_object_h
#define els_object_h

#include "els.h"


#define ELS_TYPE_MARK 6
#define NUM_TAGS 6





#define ttype(o) ((o)->ttype)
#define nvalue(o) ((o)->value.n)
#define tsvalue(o) ((o)->value.ts)
#define clvalue(o) ((o)->value.cl)
#define hvalue(o) ((o)->value.a)
#define infovalue(o) ((o)->value.i)
#define svalue(o) (tsvalue(o)->str)







#define iscfunction(o) (ttype(o) == ELS_TYPE_FUNCTION && clvalue(o)->isC)


#define ismarked(x) ((x)->mark != (x))

extern const StackObj els_Object_nullobject;
extern const char *const els_Object_typenames[];

#define els_Object_typename(o) (els_Object_typenames[ttype(o)])

lint32 els_Object_power2(lint32 n);
char *els_Object_openspace(els_VmObj *L, size_t n);

int els_Object_equalObj(const StackObj *t1, const StackObj *t2);
int els_Object_str2d(const char *s, Number *result);

#endif
